package org.weed.remote.network.client;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;

public class InteractiveSocketClient {
	public static void main(String[] args) throws Exception {
		Socket socket = new Socket("bnesproxy.apac.ibechtel.com", 8080);
		BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
		BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
		if (socket.isConnected()) {
			System.err.println("Connected to " + socket.getRemoteSocketAddress());
		}
		writer.write("hello");
		String line;
		while ((line = reader.readLine()) != null) {
			System.out.println(line);
		}
	}
}
